/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package brugafjframe;
import javax.swing.JPanel;
import java.awt.*;
/**
 *
 * @author Benjamin
 */
public class Smiley extends JPanel {
    private final int baseX = 120, baseY = 60;
    
    public Smiley(){
        setBackground(Color.CYAN);
        setPreferredSize(new Dimension(320,200));
        setFont (new Font("Arial", Font.BOLD, 16));
    }
    
    public void paintComponent(Graphics page){
        super.paintComponent(page);
        
        //head
        page.setColor(Color.YELLOW);
        page.fillOval(baseX, baseY, 100, 100);
        page.drawString("Dette er grafik i java", baseX-30, baseY-30);//Der trække noget fra højden og x værdien for at få teksten til at stå OVER ovalen.
        
    }
    
}
